<?php

namespace eu\freeplace\page;

use eu\freeplace\page\CSSLoader as CSSLoader;
use eu\freeplace\page\JSLoader  as JSLoader;
use eu\freeplace\page\model\MetaVO as MetaVO;

/**
 * Encapsulate all functions to create a complete HTML HEAD Block.
 *
 * @author Elmar Dott
 * @version 1.0
 */
class Head {

    /** Class Name */
    const CLASS_NAME = "Head";

    /**
     * Default Constructor
     * @global Logger $logger
     */
    public function __construct() {
        global $logger;
        $logger->log("Calling instance of ".self::CLASS_NAME."()", "NOTICE");
    }

    ### ########################################################################

    //Fetch all dynamic META Tags
    public function getMETA($contentId) {
        global $logger;
        $metaVO = clone new MetaVO($contentId);
        $logger->log(self::CLASS_NAME."().getMETA(".$contentId.")", "DEBUG");
        return $metaVO->getClassAttributes();
    }

    //Create all CSS File Inclusions.
    public function drawCSS() {
        global $logger;
        $logger->log(self::CLASS_NAME."().drawCSS()", "DEBUG");

        $css = new CSSLoader();
        return $css->render();
    }

    //Create all JavaScript File Inclusions.
    public function drawJS() {
        global $logger;
        $logger->log(self::CLASS_NAME."().drawJS()", "DEBUG");

        $javascript = new JSLoader();
        return $javascript->render();
    }

}//CLASS

?>
